package com.cms.service;


import java.util.Date;

import javax.security.auth.message.AuthException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cms.dao.AdminDao;
import com.cms.entity.Admin;

@Service
public class AdminService {
	
	@Autowired
	private AdminDao adminDao;
	
	public Admin addAdmin(String name,String password) throws AuthException{
		Admin admin = new  Admin();
		Date date = new Date();
		admin.setAdminName(name);
		admin.setAdminPassword(password);
		admin.setCreateTime(date);
		adminDao.addAdmin(admin);
		return admin;
	}
	
	public int adminCount(){
		return adminDao.getAdminCount();
	}
	
	public Admin getUserByCount(String count){
		Admin admin = new Admin();
		return admin;
	};
}
